package com.zxy.ziems.server.budget.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.Year;
import java.util.List;

@Data
public class BudgetDefDTO {
    /**
     * 标签名称。
     */
    @NotBlank(message = "标签名称不可为空", groups = {BudgetDefDTO.Add.class})
    private String tag;

    /**
     * 分类ID
     */
    @NotBlank(message = "分类ID不可为空", groups = {BudgetDefDTO.Add.class})
    private String classifyId;

    /**
     * 年份。
     */
    @NotNull(message = "年份不可为空", groups = {BudgetDefDTO.Add.class})
    @JsonFormat(pattern = "yyyy", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy")
    private Year budgetYear;

    /**
     * 预算管理ID。
     */
    @NotBlank(message = "预算定义ID不可为空", groups = {BudgetDefDTO.AddVal.class})
    private String budgetDefId;

    /**
     * 预算月份值
     */
    @NotEmpty(message = "预算数据不可为空", groups = {BudgetDefDTO.AddVal.class})
    private List<BudgetValDTO> budgetValDTOList;

    public interface Add { }

    public interface AddVal{ }
}
